<template>
  <el-select placeholder="请选择" v-model="form.channel_id">
            <el-option
              v-for="item in $store.state.channelsList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
</template>

<script>
import {channels} from '@/api/index.js'
export default {
name:'HmSelect',
props:['form'],
data(){
    return{
        channelsList:[]
    }
},
async created(){
  if(this.$store.channelsList.length===0){
  const res=await channels()//axios请求 异步 ajax请求
  this.$store.commit('setList',res.data.channels)
    // this.channelsList=res.data.channels
  }
  
}
}
</script>

<style>

</style>